package com.example.administrator.basepro.model.http.api;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by Administrator on 2017/3/14 0014.
 * retrofit请求的头
 */

public class HeaderInterceptor implements Interceptor{

    @Override
    public Response intercept(Chain chain) throws IOException {

        Request originRequest = chain.request();
        String url = originRequest.url().toString();

        Request request=originRequest.newBuilder()
                .addHeader("source","20")
                .addHeader("device_token","AgH2KOhABXcITRF1ioC54SwSm3Crc4ikJjd1Cby17qpp")
                .addHeader("lang","zh_CN")
                .build();

        return chain.proceed(request);
    }
}
